// 批量注册路由
const fs = require('fs')

module.exports = (app)=>{
  fs.readdirSync(__dirname).forEach(file=>{
    if (file === 'index.js') {
      return
    }
    // 引入
    const route = require(`./${file}`)
    // console.log(route)
    app.use(route.routes()).use(route.allowedMethods())
  })
}